<template>
  <div id="app">
    <div class="contentWeb">
      <div class="jobdtab">
        <div class="clear">
          <div class="zwname">{{position.positionName}}</div>
        </div>
        <div class="clear" style="padding: 10px 0" @click="toJob(position.enterpriseUid)">
          <div class="gsname">{{position.companyName}}</div>
        </div>
        <div class="jieshao">
          <span>{{position.saveCity}}</span>
          <span>{{position.experience}}经验</span>
          <span>{{position.educational}}</span>
          <span>招募{{position.zprs}}人</span>
        </div>
        <div class="fuli clear">
          <el-tag type="info"
              v-for="(item, index) in position.welfareRemark.split(',')" 
              :key="index">{{item}}
            </el-tag>
        </div>
        <div class="jprice">
          <b>{{position.wageRange}}</b>
        </div>
      </div>
      <div class="jutinr">
        <div class="qanhuiqiye">工作职责</div>
        <div class="ddk" v-html="position.positionDuty">
        </div>
        <div class="qanhuiqiye">任职资格</div>
        <div class="ddk" v-html="position.qualifications">

        </div>

        <div class="qanhuiqiye">工作地址</div>
        <div class="ddk">
          {{position.address}}
        </div>
        <div class="qanhuiqiye">企业信息</div>
        <div class="ddk">
          <div class="logosub clear">
            <div class="logo"><img :src="companyinfo.logo" alt=""></div>
            <div class="cname">
              <h2>{{companyinfo.name}}</h2>
              <div class="mss"><span>{{companyinfo.industry}}</span><span>{{companyinfo.enterpriseNature}}</span> <span>{{companyinfo.companySize}}</span></div>
            </div>
            <div class="detail_con"></div>
          </div>
          <div>
            {{companyinfo.introduction}}
          </div>
        </div>
      </div>
    </div>
    <RightMenu :showMenus="menusList" />
    <Footer/>
  </div>
</template>
<script type="text/babel">
// @ is an alias to /src
import Footer from './components/Footer'
import RightMenu from './components/RightMenu'
import { Position, GetUrlParam, addToMyCollection, applyPositionMy, EnterpriseLibByUid } from '../../assets/js/domains'

export default {
  name: 'Job',
  components: {  Footer, RightMenu },
  directives: {},
  data() {
    return {
      position_id: 0,
      position: {},
      cacheCompanyInfo:{},
      companyinfo: {},
      menusList:['scan','back','exit'],
      serach: { position_id: '', userUid: '' }
    }
  },
  created() {
    this.cacheCompanyInfo = JSON.parse(localStorage.getItem('facer_companyInfo'))
    
  },
  computed: {},
  mounted() {
    this.position_id = GetUrlParam('id')
    if (this.position_id) {
      this.getpost()
      this.getEnterpriseLibByUid(this.cacheCompanyInfo.enterpriseUid)
    }
  },
  methods: {
    welfareRemarkhtml(item) {
      if (item) {
        const mp = item.split(',')
        let htmls = ''
        for (let i = 0; i < mp.length; i++) {
          htmls = htmls + ' <div style="height: 36px;line-height: 34px;background: #f6f6f8;border: 1px solid #f6f6f8;border-radius: 6px;padding: 0 15px;font-size: 16px;float: left;margin-right: 10px;margin-top: 5px;">' + mp[i] + '</div>'
        }

        return htmls
      } else {
        return ''
      }
    },
    getEnterpriseLibByUid(id) {
      const _this = this
      EnterpriseLibByUid({ enterprise_uid: id, userUid: this.cacheCompanyInfo.id }).then(res => {
        if (res.code === 200) {
          _this.companyinfo = res.data
        } else {
          _this.$alert(res.msg, '提示')
        }
      })
    },
    getpost() {
      const _this = this
      _this.serach.position_id = this.position_id
      _this.serach.userUid = this.cacheCompanyInfo.id
      Position(_this.serach).then(res => {
        if (res.code === 200) {
          _this.position = res.data
        } else {
          _this.$alert(res.msg, '提示')
        }
      })
    },
    
  }
}
</script>
<style lang="less" scoped>
.jobdtab {
  background: #fff;
  padding: 30px;
  position: relative;

  .gsname {
    // float: left;
    height: 27px;
    font-size: 20px;
    text-decoration: underline;
    text-align: left;
    color: #f1733e;
    line-height: 27px;
  }

  .look {
    // float: left;
    height: 27px;
    margin-left: 30px;
    font-size: 16px;
    padding-left: 26px;
    text-align: left;
    color: #505050;
    line-height: 27px;
    background: url("../../assets/img/hlj.png") left  center no-repeat;
    background-size: 18px;
  }

  .btnstyle {
    position: absolute;
    z-index: 1;
    right: 30px;
    top: 140px;

    .soucang {
      // float: left;
      width: 120px;
      height: 50px;
      background: #ffffff;
      border: 1px solid #f1733e;
      border-radius: 6px;
      text-align: center;
      line-height: 50px;
      cursor: pointer;

      .tnm {
        display: inline-block;
        background: url("../../assets/img/sc.png") left center no-repeat;
        padding-left: 30px;
        background-size: 17px auto;
        line-height: 50px;
      }
    }

    .btnshenqing {
      width: 180px;
      cursor: pointer;
      height: 50px;
      // float: right;
      background: #20a2b2;
      border-radius: 6px;
      font-size: 20px;
      color: #fff;
      line-height: 50px;
      text-align: center;
      margin-left: 20px;

    }
  }
  .jprice{
    position: absolute;
    top: 50px;
    right: 30px;
    z-index: 1;
    clear: both;
    overflow: hidden;
    b{
      font-size: 30px;
      font-family: Bebas;
      color: #f23f00;
      letter-spacing: 2px;
    }
    span{
      font-size: 18px;
      color: #f23f00;
    }
  }

  .zwname {
    // float: left;
    height: 32px;
    font-size: 24px;
    text-align: left;
    line-height: 32px;
    font-weight: bold;
    cursor: pointer;
  }

  &:hover {
    .zwname {
      color: #12cde5;
    }
  }



  .jieshao {
    span {
      height: 42px;
      font-size: 16px;
      display: inline-block;
      position: relative;
      line-height: 22px;
      padding: 10px;

      &:first-child {
        padding-left: 0px;
      }

      &:before {
        position: absolute;
        content: '';
        right: 0;
        top: 13px;
        width: 1px;
        height: 18px;
        border-right: 1px solid #dcdee0;
      }

      &:last-child:before {
        border-right: 0;
      }
    }
  }
  .fuli{
    margin-top: 5px;
    .el-tag+.el-tag{margin-left: 20px;}
  }
}
.jutinr{
  background: #fff;
  padding: 30px;
  margin-top: 30px;
  min-height: 400px;
  .ddk{
    font-size: 18px;
    padding: 10px 0;
    text-align: left;
    color: #505050;
    line-height: 40px;
    p{
      color: #505050;
    }
  }
  .logosub{
    .logo{
      width: 82px;
      height: 82px;
      padding: 10px;
      border: 1px solid #dcdcdc;
      position: absolute;
      img{ width: 62px; height: 62px;}
    }
    .cname {
      padding-left: 110px;

      h2 {
        font-size: 28px;
        text-align: left;
        color: #1e1e1e;
        line-height: 37px;
        margin:10px 0;
      }

      .mss {
        span {
          height: 22px;
          font-size: 16px;
          display: inline-block;
          color: #8d8e9c;
          position: relative;
          line-height: 22px;
          padding: 10px;

          &:first-child {
            padding-left: 0px;
          }

          &:before {
            position: absolute;
            content: '';
            right: 0;
            top: 13px;
            width: 1px;
            height: 18px;
            border-right: 1px solid #dcdee0;
          }

          &:last-child:before {
            border-right: 0;
          }
        }
      }
      .taglist{
        height: 36px;
        line-height: 34px;
        background: #fcf2ea;
        border: 1px solid #e39457;
        border-radius: 6px;
        padding: 0 15px;
        color: #e39457;
        font-size: 16px;
        // float: left;
        margin-right: 10px;
        margin-top: 5px;
      }
    }
    .soucang{
      // float: right;
      width: 120px;
      height: 50px;
      background: #ffffff;
      border: 1px solid #dcdee0;
      border-radius: 6px;
      text-align: center;
      line-height: 50px;
      margin-top: 30px;
      margin-right: 20px;
      .tnm{
        display: inline-block;
        background: url("../../assets/img/sc.png") left center no-repeat;
        padding-left: 30px;
        background-size: 17px auto;
        line-height: 50px;
      }
    }

  }
}
.qanhuiqiye {
  font-size: 22px;
  line-height: 48px;
  height: 48px;
  position: relative;
  padding-left: 12px;
  font-family: MicrosoftYaHeiSemibold;

  &:before {
    position: absolute;
    content: '';
    left: 0px;
    top: 18px;
    width: 4px;
    z-index: 1;
    height: 14px;
    background: #20a2b2;

  }
}

</style>
